{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function() {
	
});
</script>
{/block}
{block name=body}

<span style="float:left;"><button onclick="window.close();">Close</button></span>
<form name="form1" id="form1" action="{$smarty.server.PHP_SELF}" method="post">
<table align="center" border="0" cellpadding="2" cellspacing="2" >
<tr>
  <td align="center" class="table1" colspan="9">Bill Detail</td>
</tr>
<tr>
	<td align="center" class="table1" colspan="3">Party</td>
	<td align="center" class="table1" colspan="3">Bill Memo</td>
	<td align="center" class="table1" colspan="3">Memo Date</td>
</tr>
<tr>
	<td align="center" class="table2" colspan="3">
  <select name="partyId" id="partyId" required="required" AUTOFOCUS >
  <option value="">Select</option>
  {html_options values=$partyArray.partyId output=$partyArray.partyName selected=$masterArray.partyId}
  </select>
  </td>
	<td align="center" class="table2" colspan="3"><input type="text" size="25" name="billNo" id="billNo" {$masterArray.billNo} value="{$masterArray.billNo}"</td>
	<td align="center" class="table2" colspan="3">{html_select_date prefix="billDate" time=$masterArray.billDate start_year="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
</tr>
<tr><td align="center" colspan="9"><hr></td></tr>
<tr>
	<td align="center" class="table1">Out. Date</td>
	<td align="center" class="table1">Out. Challan</td>
	<td align="center" class="table1">In. Challan</td>
	<td align="center" class="table1">Material</td>
	<td align="center" class="table1">Final Process</td>
	<td align="center" class="table1">Weight</td>
	<td align="center" class="table1">Quantity</td>
	<td align="center" class="table1">Rate</td>
	<td align="center" class="table1">Amount</td>
</tr>
{section name=sec loop=$detailArray}
<tr>
  <td align="center" class="table2" NOWRAP>
    {html_select_date prefix="outDate" time=$detailArray[sec].date start_year="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	<td align="center" class="table2"><input type="text" size="10" name="outChallenNo" id="outChallenNo" {$detailArray[sec].outChallenNo} value="{$detailArray[sec].outChallenNo}"/></td>
	<td align="center" class="table2"><input type="text" size="10" name="inChallenNo" id="inChallenNo" {$detailArray[sec].inChallenNo} value="{$detailArray[sec].inChallenNo}"/></td>
	<td align="center" class="table2">
	  <select name="materialId" id="materialId" required="required" AUTOFOCUS >
      <option value="">Select</option>
      {html_options values=$catmaterialArray.materialId output=$catmaterialArray.materialName selected=$detailArray[sec].materialId}
    </select>
  </td>
	<td align="center" class="table2">
	  <select name="finalProcess" id="finalProcessId" required="required" AUTOFOCUS >
      <option value="">Select</option>
      {html_options values=$catprocessArray.finalProcessId output=$catprocessArray.finalProcessName selected=$detailArray[sec].finalProcess}
    </select>
  </td>
  <td align="right" class="table2"><input type="text" size="10" name="outQuantity" id="outQuantity" {$detailArray[sec].outQuantity} value="{$detailArray[sec].outQuantity}"/></td>
	<td align="right" class="table2"><input type="text" size="10" name="outWieght" id="outWieght" {$detailArray[sec].outWieght} value="{$detailArray[sec].outWieght}"/></td>
	<td align="right" class="table2"><input type="text" size="10" name="outRate" id="outRate" {$detailArray[sec].outRate} value="{$detailArray[sec].outRate}"/></td>
	<td align="right" class="table2"><input type="text" size="15" name="amount" id="amount" {$detailArray[sec].amount} value="{$detailArray[sec].amount}"/></td>
</tr>
{/section}
<tr>
	<td align="right" class="table1" colspan="7">Sub Total</td>
	<td align="center" class="table2">:</td>
	<td align="center" class="table1"><input type="text" size="15" name="total" id="total" {$masterArray.total} value="{$masterArray.total}"</td>
</tr>
<tr>
	<td align="right" class="table1" colspan="7">Service Tax + Edu. Cess</td>
	<td align="center" class="table2"><input type="text" size="10" name="taxInPrecentage" id="taxInPrecentage" {$masterArray.taxInPrecentage} value="{$masterArray.taxInPrecentage}" />  %  </td>  
	<td align="center" class="table1"><input type="text" size="15" name="serviceTax" id="serviceTax" {$masterArray.serviceTax} value="{$masterArray.serviceTax}"</td>
</tr>
<tr>
	<td align="right" class="table1" colspan="7">Round Off</td>
	<td align="center" class="table2">:</td>
	<td align="center" class="table1"><input type="text" size="15" name="roundOff" id="roundOff" {$masterArray.roundOff} value="{$masterArray.roundOff}"</td>
</tr>
<tr>
	<td align="right" class="table1" colspan="7">Net Total</td>
	<td align="center" class="table2">:</td>
	<td align="center" class="table1"><input type="text" size="15" name="netTotal" id="netTotal" {$masterArray.netTotal} value="{$masterArray.netTotal}"</td>
</tr>
<tr>
  <td align="center" colspan="10" align="center" class="table1"><input type="submit" name="updateBtn" value="Update" class="button" /></td>
</tr>	
</table>
</form>
{/block}